<?PHP
 session_start();
 include("admin/include/db.php");
 include("includes/session.php");
 
 $userId = $_SESSION['user_id'];
 
 
 if(isset($_REQUEST) && $_REQUEST['submit'] != ''){

	$meeting_link 		= mysql_real_escape_string($_REQUEST['meeting_link']); 
	$meeting_dial		= mysql_real_escape_string($_REQUEST['meeting_dial']);
	$access_code 		= mysql_real_escape_string($_REQUEST['access_code']); 
	$meeting_ids		= mysql_real_escape_string($_REQUEST['meeting_ids']);
	$meeting_time		= mysql_real_escape_string($_REQUEST['meeting_time']);
	$meeting_date		= mysql_real_escape_string($_REQUEST['meeting_date']);
	$training			= mysql_real_escape_string($_REQUEST['training']);
	$software			= mysql_real_escape_string($_REQUEST['software']);
	$meeting_hours		= mysql_real_escape_string($_REQUEST['hours']);
	$meeting_min		= mysql_real_escape_string($_REQUEST['minute']);
	$meeting_time		= $meeting_hours . '-' . $meeting_min ;
	
	$sqlCategory = "INSERT INTO software_meeting
								 SET 
							meeting_link				=	'$meeting_link',
							meeting_dial				=	'$meeting_dial',
							access_code					=	'$access_code',
							meeting_ids					=	'$meeting_ids',
							meeting_time				=	'$meeting_time',
							meeting_date				=	'$meeting_date',
							user_id						=   '$userId',
							training					=	'$training',
							software					=	'$software'
							
							"; 	
	if(mysql_query($sqlCategory))
	{
		header("location:meeting.php?msg=1");
	}else{
		header("location:meeting.php?msg=2");
	}

	exit();		
 }

?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=TITLE_WEBSITE?></title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<script>
function validation(){
	
	var message = '';

	if(document.getElementById("hours").value == ""){
		message += 'Please enter your meeting time\n';
	}
	if(document.getElementById("minute").value == ""){
		message += 'Please enter your meeting minute\n';
	}
	if(document.getElementById("meeting_date").value == ""){
		message += 'Please enter your meeting date\n';
	}
	if(document.getElementById("meeting_link").value == ""){
		message += 'Please enter your meeting link\n';
	}
	if(document.getElementById("meeting_dial").value == ""){
		message += 'Please enter your dial code\n';
	}
	if(document.getElementById("access_code").value == ""){
		message += 'Please enter your access code\n';
	}
	
	if(message != ""){
		alert(message);
		return false;
	}
	
	
}
</script>
<body>
<center>
<div style="background:#179cc1; height:3px">&nbsp;</div>
<div style="width:990px;" align="center">
		<div id="header">
		<?php
    		include("includes/header.php");
   		?>
        </div>
    <div style="margin-top:20px;">
    	 <div style=" width:25%; float:left" >
             <?php 
			    if($_SESSION['user_type'] == 'Student')
				{
			 		include("includes/studentLeftMenu.php");
				}elseif($_SESSION['user_type'] == 'Trainer'){
					include("includes/trainerLeftMenu.php");
				}elseif($_SESSION['user_type'] == 'Training Institute'){
					include("includes/instituteLeftMenu.php");
				}
				?>
        </div>
        <div style="width:75%;float:left">
        	<div style="margin-top:20px;">
    	<form id="form_login" name="form_login" method="post" onsubmit="return login_validation()" >
    	<?php
		$msg = $_REQUEST['msg'];
        if($msg != "")
		{
			if($msg == 1){
				$showMessage = 'Your meeting is updated successfully';
				$clsMessage = 'clsSuccess';	
			}else if($msg == 2){
				$showMessage = 'Sorry,your meeting is not added';
				$clsMessage = 'clsError';
			}
		?>
        <div align="left" class="<?=$clsMessage?>" style="margin-bottom:10px" >
           &nbsp; 	 <?=$showMessage?>
        </div>
        <?php
		}
		?>
        
        </form>
        <form id="form_register" name="form_register" method="post" onsubmit="return validation()" >
        <div style="width:85%; margin-left:40px" >
        	<div align="left" >
            	<span class="headingOrange" ><strong>Demo's Meeting</strong></span>
            </div>
            <div class="text1"  align="left" >
         		  <div  style=" padding-top:18px;" >	
                    <div style="float:left; width:30%" class="text" >Meeting Date:</div>
                    <div style="float:left; width:70%" ><input type="text" id="meeting_date" class="textBox" name="meeting_date" value="<?=$_REQUEST['meeting_date']?>" maxlength="30" /> </div>
                    <div style=" clear:both" ></div>
                </div>
                 <div style=" padding-top:10px;" >	
                    <div style="float:left; width:30%" class="text" >Meeting Time:</div>
                    <div style="float:left; width:70%" >
                    <select id="hours" name="hours"  class="textBox1">
                      <option value="00 hr" >0 Hour</option>
                      <option value="01 hr" >1 Hour</option>
                      <option value="02 hr" >2 Hour</option>
                      <option value="03 hr" >3 Hour</option>
                      <option value="04 hr" >4 Hour</option>
                      <option value="05 hr" >5 Hour</option>
                      <option value="06 hr" >6 Hour</option>
                      <option value="07 hr" >7 Hour</option>
                      <option value="08 hr" >8 Hour</option>
                      <option value="09 hr" >9 Hour</option>
                      <option value="10 hr" >10 Hour</option>
                      <option value="11 hr" >11 Hour</option>
                      <option value="12 hr" >12 Hour</option>
                      <option value="13 hr" >13 Hour</option>
                      <option value="14 hr" >14 Hour</option>
                      <option value="15 hr" >15 Hour</option>
                      <option value="16 hr" >16 Hour</option>
                      <option value="17 hr" >17 Hour</option>
                      <option value="18 hr" >18 Hour</option>
                      <option value="19 hr" >19 Hour</option>
                      <option value="20 hr" >20 Hour</option>
                      <option value="21 hr" >21 Hour</option>
                      <option value="22 hr" >22 Hour</option>
                      <option value="23 hr" >23 Hour</option>
                    </select>
                    <select id="minute" name="minute"  class="textBox1">
                    <?php
                    for($i = 0;$i<=59 ; $i++)
					{?>
                    <option value="<?php echo $i;?> min" ><?php echo $i;?> Min</option>
                    <?php
                    }
					?>
                    </select>
                    </div>
                    <div style=" clear:both" ></div>
                </div>
                 <div  style=" padding-top:10px;"  >	
                    <div style="float:left; width:30%" class="text" >Meeting Link:</div>
                    <div style="float:left; width:70%" ><input type="text" id="meeting_link" class="textBox" name="meeting_link" value="<?=$_REQUEST['meeting_link']?>" maxlength="60" /> </div>
                    <div style=" clear:both" ></div>
                </div>
                
                <div style="margin-top:10px"  >	
                    <div style="float:left; width:30%" class="text" >Dial:</div>
                    <div style="float:left; width:70%" ><input type="text" id="meeting_dial" class="textBox" name="meeting_dial" value="<?=$_REQUEST['meeting_dial']?>"  maxlength="30" /> </div>
                    <div style=" clear:both" ></div>
                </div>
                <div  style="margin-top:10px" >	
                    <div style="float:left; width:30%" class="text" >Access Code:</div>
                    <div style="float:left; width:70%" ><input type="text" id="access_code" class="textBox" name="access_code" value="<?=$_REQUEST['access_code']?>" maxlength="30"  /> </div>
                    <div style=" clear:both" ></div>
                </div>
                 <div  style="margin-top:10px" >	
                    <div style="float:left; width:30%" class="text" >Meeting Id:</div>
                    <div style="float:left; width:70%" ><input type="text" id="meeting_ids" class="textBox" name="meeting_ids" value="<?=$_REQUEST['meeting_ids']?>" maxlength="30"  /> </div>
                    <div style=" clear:both" ></div>
                </div>
                  <div  style="margin-top:10px" >	
                    <div style="float:left; width:30%" class="text" >Training:</div>
                    <div style="float:left; width:70%" ><input type="text" id="training" class="textBox" name="training" value="<?=$training?>" maxlength="30"  /> </div>
                    <div style=" clear:both" ></div>
                </div>
                 <div  style="margin-top:10px" >	
                    <div style="float:left; width:30%" class="text" >Software:</div>
                    <div style="float:left; width:70%" ><input type="text" id="software" class="textBox" name="software" value="<?=$software?>" maxlength="30"  /> </div>
                    <div style=" clear:both" ></div>
                </div>
                
                 <div style="margin-top:10px;" align="center">	
                 	<input type="hidden" id="action" name="action" value="set_meeting"  />
                   	<input type="submit" class="button" name="submit" id="submit" value="Set Demo"  />
                </div>
                 
            </div>
        </div>
        </form>
      <div style="clear:both"></div>
    </div>
        	
        </div>
        <div style="clear:both"></div>
    </div>
    
    <div style="margin-top:23px; margin-bottom:21px" align="center" >
    	<?php
									$sqlAdvertise = mysql_query("SELECT * FROM software_advertise 
																	WHERE 
																		banner_status = 'Y' AND banner = 2
																		ORDER BY RAND()
																		");
									$resAdvertise = mysql_fetch_array($sqlAdvertise);
							
									$imgPath  = 'admin/upload_images/'.$resAdvertise["banner_image"];
									
								?>
								
    </div>
   </div>
   <div id="footer">
  		<?php include("includes/footer.php")?>
   </div>
</div>
	</div>
</center>
</body>
</html>
<link rel="stylesheet" href="js/jQuery/themes/base/jquery.ui.all.css">
<script src="js/jQuery/jquery-1.8.0.js"></script>
<script src="js/jQuery/ui/jquery.ui.core.js"></script>
<script src="js/jQuery/ui/jquery.ui.widget.js"></script>
<script src="js/jQuery/ui/jquery.ui.datepicker.js"></script>
<link rel="stylesheet" href="js/jQuery/demos.css">
<script>
$( "#meeting_date").datepicker();
</script>